\(\int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx\) [155]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 48 \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=-\frac {a \text {arctanh}(\cos (e+f x))}{2 f}-\frac {b \cot (e+f x)}{f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f} \]

[Out]

-1/2*a*arctanh(cos(f*x+e))/f-b*cot(f*x+e)/f-1/2*a*cot(f*x+e)*csc(f*x+e)/f

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2827, 3853, 3855, 3852, 8} \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=-\frac {a \text {arctanh}(\cos (e+f x))}{2 f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f}-\frac {b \cot (e+f x)}{f} \]

[In]

Int[Csc[e + f*x]^3*(a + b*Sin[e + f*x]),x]

[Out]

-1/2*(a*ArcTanh[Cos[e + f*x]])/f - (b*Cot[e + f*x])/f - (a*Cot[e + f*x]*Csc[e + f*x])/(2*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2827

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a \int \csc ^3(e+f x) \, dx+b \int \csc ^2(e+f x) \, dx \\ & = -\frac {a \cot (e+f x) \csc (e+f x)}{2 f}+\frac {1}{2} a \int \csc (e+f x) \, dx-\frac {b \text {Subst}(\int 1 \, dx,x,\cot (e+f x))}{f} \\ & = -\frac {a \text {arctanh}(\cos (e+f x))}{2 f}-\frac {b \cot (e+f x)}{f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.90 \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=-\frac {b \cot (e+f x)}{f}-\frac {a \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {a \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f} \]

[In]

Integrate[Csc[e + f*x]^3*(a + b*Sin[e + f*x]),x]

[Out]

-((b*Cot[e + f*x])/f) - (a*Csc[(e + f*x)/2]^2)/(8*f) - (a*Log[Cos[(e + f*x)/2]])/(2*f) + (a*Log[Sin[(e + f*x)/
2]])/(2*f) + (a*Sec[(e + f*x)/2]^2)/(8*f)

Maple [A] (verified)

Time = 1.36 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {a \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{2}\right )-b \cot \left (f x +e \right )}{f}\) \(50\)
default \(\frac {a \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{2}\right )-b \cot \left (f x +e \right )}{f}\) \(50\)
parallelrisch \(\frac {4 a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\left (-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+\cot \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \left (\cot \left (\frac {f x}{2}+\frac {e}{2}\right ) a +a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+4 b \right )}{8 f}\) \(69\)
risch \(-\frac {i \left (i a \,{\mathrm e}^{3 i \left (f x +e \right )}+i a \,{\mathrm e}^{i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{2 f}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{2 f}\) \(99\)
norman \(\frac {-\frac {a}{8 f}+\frac {a \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}-\frac {b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 f}+\frac {b \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}-\frac {a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}+\frac {a \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}\) \(118\)

[In]

int(csc(f*x+e)^3*(a+b*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*(a*(-1/2*csc(f*x+e)*cot(f*x+e)+1/2*ln(-cot(f*x+e)+csc(f*x+e)))-b*cot(f*x+e))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 96 vs. \(2 (44) = 88\).

Time = 0.28 (sec) , antiderivative size = 96, normalized size of antiderivative = 2.00 \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {4 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 2 \, a \cos \left (f x + e\right ) - {\left (a \cos \left (f x + e\right )^{2} - a\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left (a \cos \left (f x + e\right )^{2} - a\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left (f \cos \left (f x + e\right )^{2} - f\right )}} \]

[In]

integrate(csc(f*x+e)^3*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/4*(4*b*cos(f*x + e)*sin(f*x + e) + 2*a*cos(f*x + e) - (a*cos(f*x + e)^2 - a)*log(1/2*cos(f*x + e) + 1/2) + (
a*cos(f*x + e)^2 - a)*log(-1/2*cos(f*x + e) + 1/2))/(f*cos(f*x + e)^2 - f)

Sympy [F]

\[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=\int \left (a + b \sin {\left (e + f x \right )}\right ) \csc ^{3}{\left (e + f x \right )}\, dx \]

[In]

integrate(csc(f*x+e)**3*(a+b*sin(f*x+e)),x)

[Out]

Integral((a + b*sin(e + f*x))*csc(e + f*x)**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.25 \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {a {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {4 \, b}{\tan \left (f x + e\right )}}{4 \, f} \]

[In]

integrate(csc(f*x+e)^3*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/4*(a*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) + log(cos(f*x + e) - 1)) - 4*b/tan(f*x + e
))/f

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.79 \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 4 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \frac {6 \, a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 4 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2}}}{8 \, f} \]

[In]

integrate(csc(f*x+e)^3*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

1/8*(a*tan(1/2*f*x + 1/2*e)^2 + 4*a*log(abs(tan(1/2*f*x + 1/2*e))) + 4*b*tan(1/2*f*x + 1/2*e) - (6*a*tan(1/2*f
*x + 1/2*e)^2 + 4*b*tan(1/2*f*x + 1/2*e) + a)/tan(1/2*f*x + 1/2*e)^2)/f

Mupad [B] (verification not implemented)

Time = 6.60 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.69 \[ \int \csc ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{2\,f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a}{2}+2\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{4\,f}+\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,f}+\frac {a\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{2\,f} \]

[In]

int((a + b*sin(e + f*x))/sin(e + f*x)^3,x)

[Out]

(b*tan(e/2 + (f*x)/2))/(2*f) - (cot(e/2 + (f*x)/2)^2*(a/2 + 2*b*tan(e/2 + (f*x)/2)))/(4*f) + (a*tan(e/2 + (f*x
)/2)^2)/(8*f) + (a*log(tan(e/2 + (f*x)/2)))/(2*f)